<?php
/**
 * Created by PhpStorm.
 * User: liandne
 * Date: 2016/12/12
 * Time: 上午11:12
 */
namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Packages
 *
 * @property integer $id 标识
 * @property string $pak_name 套餐名称
 * @property string $pak_subject 套餐科目
 * @property string $pak_detail 套餐简介
 * @property float $consulting_fee 顾问费
 * @property float $bespeak_fee 套餐费
 * @property integer $is_personal 是否私人定制
 * @property integer $is_off 是否关 (0:否 1:是)
 * @property string $deleted_at
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\PakHug[] $hug
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Orders[] $orders
 * @method static \Illuminate\Database\Query\Builder|\App\Packages whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Packages wherePakName($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Packages wherePakSubject($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Packages wherePakDetail($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Packages whereConsultingFee($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Packages whereBespeakFee($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Packages whereIsPersonal($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Packages whereIsOff($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Packages whereDeletedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Packages whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Packages whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property integer $pak_img 套餐图
 * @method static \Illuminate\Database\Query\Builder|\App\Packages wherePakImg($value)
 */
class Packages extends Model {

    protected $table = 'packages';
    use SoftDeletes;

    /**
     * 休息套餐表关联
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function hug(){
        return $this->hasMany('App\PakHug','pak_id');
    }

    /**
     * 订单表关联
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function orders(){
        return $this->hasMany('App\Orders','package_id');
    }
}
